import { createPinia } from "pinia";
import { createPersistedState } from "pinia-plugin-persistedstate";

export { useUserStore } from "./modules/user";
export { useAuthStore } from "./modules/auth";

// pinia persist
const pinia = createPinia();
pinia.use(
  createPersistedState({
    auto: true,
    storage: sessionStorage,
    key: id => `store-${id}`
  })
);

export default pinia;
